package io.modifier.basic.emo.ui.core.ex

import android.os.Build
import android.view.Window
import android.view.WindowManager

fun Window.setNavTransparent() {
    navigationBarColor = android.graphics.Color.TRANSPARENT
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
        navigationBarDividerColor = android.graphics.Color.TRANSPARENT
    }
}

fun Window.setNormalDisplayCutoutMode() {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
        attributes.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS
    } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
        attributes.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES
    }
}
